<?php

namespace Drupal\ui_mlt\MetadataController;

use EntityDefaultMetadataController;

class UiMltMetadataController extends EntityDefaultMetadataController {

  public function entityPropertyInfo() {
    $info = parent::entityPropertyInfo();
    $properties = &$info[$this->type]['properties'];

    $properties['user'] = [
      'label' => t('所属用户'),
      'type' => 'user',
      'setter callback' => 'entity_property_verbatim_set',
      'setter permission' => 'administer wechat response message',
      'schema field' => 'uid',
      'required' => TRUE,
      'description' => t('Create time of wechat response message.'),
    ];

    $properties['created'] = [
      'label' => t('创建时间'),
      'type' => 'date',
      'setter callback' => 'entity_property_verbatim_set',
      'setter permission' => 'administer profiles',
      'schema field' => 'created',
      'description' => t('时间.'),
    ];
    $properties['changed'] = [
      'label' => t('修改时间'),
      'type' => 'date',
      'setter callback' => 'entity_property_verbatim_set',
      'setter permission' => 'administer profiles',
      'schema field' => 'changed',
      'description' => t('时间.'),
    ];
    return $info;
  }
}
